package com.msw.jcwapi.common.parametor.controller;

import com.msw.jcwapi.common.parametor.model.WbstructPara;
import com.msw.jcwapi.common.parametor.service.WbstructParaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.List;

@RestController
public class WbstructParaController {
    @Autowired
    private WbstructParaService wbstructParaService;
    @GetMapping("/wbstructpara")
    public List<WbstructPara> wbstructpara() {
        try {
            return wbstructParaService.loadParameters();
        } catch (IOException e) {
            e.printStackTrace();
            // 可以返回一个错误响应或空列表等
            return List.of();
        }
    }
}
